package com.xy.day4.biz;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xy.day4.dao.TypeMapper;
import com.xy.day4.entity.Type;

@Service
public class TypeBiz {

	@Resource
	private TypeMapper dao;
	
	public void save(Type tp) {
		dao.insert(tp);
	}
	
	public void delete(Type tp) {
		dao.deleteByPrimaryKey(tp.getTypeId());
	}
	
	public void update(Type tp) {
		dao.updateByPrimaryKey(tp);
	}
	
	public List<Type> findAll() {
		return dao.selectAll();
	}
	
	public Type findById(int id) {
		return dao.selectByPrimaryKey(id);
	}
}
